package dto

import "danmu/model"

type CarouselDto struct {
	ID uint `json:"id"`
	Title   string `json:"title"`
	Img string `json:"img"`
	Url     string `json:"url"`
}

func ToCarouselDto(carousel []model.Carousel) []CarouselDto {
	newCarousel := make([]CarouselDto, len(carousel))
	for i := 0; i < len(carousel); i++ {
		newCarousel[i].ID = carousel[i].ID
		newCarousel[i].Title = carousel[i].Title
		newCarousel[i].Img = carousel[i].Img
		newCarousel[i].Url = carousel[i].Url
	}
	return newCarousel
}